package com.guigui.erp.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.guigu.erp.pojo.SystemUsers;
import com.guigu.erp.service.DesignFileService;
import com.guigu.erp.service.SystemUsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;

/**
 * @author Lenovo
 */
@CrossOrigin
@Controller
@RequestMapping("/System/Users")
public class SystemUsersController {
    @Autowired
    private SystemUsersService systemUsersService;

    //登录
    @RequestMapping("login")
    @ResponseBody
    public SystemUsers login(@RequestBody SystemUsers user){
        QueryWrapper<SystemUsers> wrapper = new QueryWrapper<>();
        wrapper.eq("LOGIN_ID",user.getLoginId());
        wrapper.eq("PASSWORD",user.getPassword());
        return systemUsersService.getOne(wrapper);
    }
}
